package threshold;

import java.util.Scanner;

/**
 * @Author wujiaming
 * @Description TODO
 * @Date 2023-03-14 17:01
 * @Version 1.0
 */
public class DUiChSu {

    public void isDuiChSu(int[] nums){
        for (Integer num:nums
             ) {
            int len = num.toString().length();
            //长度大于五位数不是对称数
            if(len>5){
                System.out.println("No");
                continue;
            }
            if(isPrim(num) && isDuiChen(num)){
                System.out.println("Yes");
            }else{
                System.out.println("No");
            }
        }
    }

    //判断是否为素数
    public Boolean isPrim(int num){
        if(num<=1){
            return false;
        }
        for(int i=2;i<num-1;i++){
            if(num%i==0){
                return false;
            }
        }
        return true;
    }

    //判断是否为对称数
    public Boolean isDuiChen(int num){
        Integer a = num;
        StringBuffer str = new StringBuffer(a.toString());
        StringBuffer rev_str = new StringBuffer(str).reverse();
        System.out.println(str);
        System.out.println(rev_str);
        return rev_str.toString().equals(str.toString());
    }
    public static void main(String[] args) {
//        Scanner sc = new Scanner(System.in);
        DUiChSu test = new DUiChSu();
//        int N = sc.nextInt();
//        int[] nums = new int[N];
//        for (int i = 0; i <N ; i++) {
//            nums[i] =sc.nextInt();
//        }
//        test.isDuiChSu(nums);

        ;
        System.out.println(test.isDuiChen(121));
    }
}
